/*
 * ToolsFunctions.h
 *	Headers for the common tool functions
 *  Created on: 23 nov. 2009
 *      Authors: Bruno CAUSSIN 				<caussin@ecole.ensicaen.fr>
 *      		 Stéphanie PLEYER			<pleyer@ecole.ensicaen.fr>
 *      		 Charles-Edouard VIDOINE	<vidoine@ecole.ensicaen.fr
 */

#ifndef TOOLSFUNCTIONS_H_
#define TOOLSFUNCTIONS_H_

#include "OrientationImage.h"

char *str_replace(char *str, char *orig, char *rep);
char * extension(char * filename);
xmlDocPtr getdoc (char *docname);
xmlXPathObjectPtr getnodeset (xmlDocPtr doc, xmlChar *xpath);
void analyseXMLFile(char * filepath,char * classe, FILE * fichier);
void analyseDir(DIR * rep, char * dirname, char * classe, FILE * fichier);
void seekForClass(char * dirname, char * classe);

/* Calcule la distance (au carré !) de deux vecteurs de dimension dim*/
double distanceVect(double* v1, double* v2, int dim);

// writes all the filenames of an input folder to a file
void ll(char * dirname, char * llfilename);

void normalize(double ** mat,int nb);
void normalize2(double * mat);


#endif /* TOOLSFUNCTIONS_H_ */
